// $Id: BaseImportPlugin.cs 66 2008-05-07 19:57:30Z nvivo $

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace DBLGen.Plugins.Import
{
    public abstract class BaseImportPlugin : ImportPlugin
    {
        protected abstract DbConnection CreateConnection();

        protected DataTable GetSchema(string collectionName)
        {
            DataTable dt;

            using (DbConnection connection = CreateConnection())
            {
                connection.Open();
                dt = connection.GetSchema(collectionName);
                connection.Close();
            }

            return dt;
        }
    }
}
